<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        p{  
            position:fixed;
            z-index: 2;
            font-size: 80px;
            color:blueviolet;
            font-family: "微软雅黑";
            font-weight:bolder;
            text-align: center;
            top:-3px;
        }
        *{
            margin:0;
            padding:0;
        }
        
        html,body{
            width: 100%;
            height:100%;
            /* 让容器的宽高都充满全屏 ，只设置body不行，因为父级没设置，所以不起效果*/
        }
        /* 弹性盒模型 */
        body{
            background-color: pink;
            display: flex;
            flex-direction: row;
            align-items: center;
            /* 水平居中 */
            justify-content: center;
            /* 垂直居中 */
        }
        /* 正方形的实现 */
        .heart{
            width: 200px;
            height:200px;
            background-color: red; 
            position: relative;
            transform: rotate(45deg);
            /* 表示顺时针旋转45度 */
            animation: heartbit 1s alternate infinite;
            box-shadow: 0 0 30px red;
        }
        /* 两个半圆的实现 ，通过伪元素实现*/
        .heart::before{
            content: "";
            width: 200px;
            height:100px;
            background-color: red;
            position:absolute;
            top: -99px;
            left:0;
            border-radius: 100px 100px 0 0;
            box-shadow: 0 0 30px red;
        }
        .heart::after{
            content: "";
            width: 100px;
            height:200px;
            background-color: red;
            position:absolute;
            top: 0;
            left:-99px;
            border-radius: 100px 0 0 100px;
            box-shadow: 0 0 30px red;
        }
        /* 实现动画，让♥跳动起来 */
        @keyframes heartbit{
            0%{
                transform: rotate(45deg) scale(0.6);
            }
            /* 25%{
                transform: rotate(45deg) scale(0.8);
            }
            50%{
                transform: rotate(45deg) scale(1.0);
            }
            75%{
                transform: rotate(45deg) scale(1.2);
            } */
            100%{
                transform: rotate(45deg) scale(1.4);
            }
        }
        
    </style>
</head>
<body>
    
    <div class="heart"></div>
    <p>胡华娜快看这个♥</p>

</body>
</html>